/* 材料节点主容器 */
.material-node {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  min-width: 200px;
  max-width: 350px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  position: relative;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  overflow: hidden;
}

.material-node:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  transform: translateY(-2px);
}

.material-node.selected {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15), 0 8px 24px rgba(0, 0, 0, 0.12);
}

.material-node.expanded {
  max-width: 400px;
}

/* 主要内容区域 */
.material-main {
  padding: 16px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.material-main:hover {
  background: rgba(59, 130, 246, 0.02);
}

/* 头部区域 */
.material-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.material-icon {
  font-size: 20px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  border-radius: 8px;
  color: white;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.material-info {
  flex: 1;
}

.material-title {
  font-weight: 600;
  font-size: 16px;
  color: #1f2937;
  margin-bottom: 2px;
}

.material-status {
  font-size: 12px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 12px;
  display: inline-block;
}

.material-status.ready {
  background: #dcfce7;
  color: #166534;
}

.material-status.pending {
  background: #fef3c7;
  color: #92400e;
}

.expand-indicator {
  font-size: 12px;
  color: #6b7280;
  transition: transform 0.2s ease;
}

.material-node.expanded .expand-indicator {
  transform: rotate(0deg);
}

/* 摘要区域 */
.material-summary {
  font-size: 13px;
  color: #6b7280;
  padding: 8px 12px;
  background: rgba(59, 130, 246, 0.05);
  border-radius: 8px;
  border-left: 3px solid #3b82f6;
}

/* 配置面板 */
.material-config {
  border-top: 1px solid #e2e8f0;
  background: #f8fafc;
}

/* 类型选择标签 */
.type-tabs {
  display: flex;
  border-bottom: 1px solid #e2e8f0;
}

.type-tab {
  flex: 1;
  padding: 12px 8px;
  background: none;
  border: none;
  font-size: 12px;
  font-weight: 500;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.2s ease;
  border-bottom: 2px solid transparent;
}

.type-tab:hover {
  background: rgba(59, 130, 246, 0.05);
  color: #3b82f6;
}

.type-tab.active {
  color: #3b82f6;
  border-bottom-color: #3b82f6;
  background: rgba(59, 130, 246, 0.05);
}

/* 配置内容区域 */
.config-content {
  padding: 16px;
}

/* 上传按钮 */
.upload-btn {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.upload-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

/* 文本输入框 */
.text-input {
  width: 100%;
  padding: 12px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  resize: vertical;
  transition: border-color 0.2s ease;
}

.text-input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* URL输入组 */
.url-input-group {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.url-input {
  flex: 1;
  padding: 8px 12px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 13px;
  transition: border-color 0.2s ease;
}

.url-input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.add-btn {
  padding: 8px 16px;
  background: #10b981;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.add-btn:hover {
  background: #059669;
  transform: scale(1.05);
}

/* 项目列表 */
.item-list {
  margin-top: 12px;
  max-height: 150px;
  overflow-y: auto;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: white;
  border-bottom: 1px solid #f1f5f9;
  font-size: 12px;
  transition: background 0.2s ease;
}

.item:last-child {
  border-bottom: none;
}

.item:hover {
  background: #f8fafc;
}

.item-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-right: 8px;
  color: #374151;
  font-weight: 500;
}



.remove-btn {
  background: #ef4444;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 4px 6px;
  font-size: 10px;
  cursor: pointer;
  min-width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.remove-btn:hover {
  background: #dc2626;
  transform: scale(1.1);
}

/* 滚动条样式 */
.item-list::-webkit-scrollbar {
  width: 4px;
}

.item-list::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 2px;
}

.item-list::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 2px;
}

.item-list::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* 响应式调整 */
@media (max-width: 768px) {
  .material-node.expanded {
    max-width: 320px;
  }

  .item-list {
    max-height: 120px;
  }

  .type-tab {
    padding: 10px 6px;
    font-size: 11px;
  }
}

/* 文件夹路径输入框样式 */
.folder-path-input-group {
  margin-top: 12px;
  padding: 12px;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.path-label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: #64748b;
  margin-bottom: 6px;
}

.folder-path-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  font-family: 'Consolas', 'Monaco', monospace;
  background: white;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.folder-path-input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.folder-path-input::placeholder {
  color: #9ca3af;
  font-style: italic;
}

/* 路径输入容器 */
.path-input-container {
  display: flex;
  gap: 8px;
  align-items: center;
}

.path-input-container .folder-path-input {
  flex: 1;
  margin: 0;
}

/* 确定按钮样式 */
.confirm-path-btn {
  padding: 8px 16px;
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  min-width: 60px;
}

.confirm-path-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.confirm-path-btn:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(59, 130, 246, 0.2);
}

.confirm-path-btn:disabled {
  background: #9ca3af;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
